package com.flitsneak.designpatterns.creationalpatterns.builder;

import java.util.ArrayList;

/**
 * Author: flitsneak
 * Date: 2022/6/6 11:40
 * Description:
 */
public abstract class RomanticModel {
    private ArrayList<String> sequence = new ArrayList<String>(6);

    protected abstract void flower();

    protected abstract void redCandle();

    protected abstract void redWine();

    final public void layout() {
        for (int i = 0; i < this.sequence.size(); i++) {
            String stepName = this.sequence.get(i);
            if (stepName.equalsIgnoreCase("flower")){
                this.flower();
            }else if (stepName.equalsIgnoreCase("red candle")){
                this.redCandle();
            }else if (stepName.equalsIgnoreCase("red wine")){
                this.redWine();
            }
        }
    }

    final public void setSequence(ArrayList<String> sequence) {
        this.sequence = sequence;
    }
}
